﻿Imports System
Imports System.Collections
Imports System.ComponentModel.Design.Serialization

Namespace System.Workflow.ComponentModel.Serialization
    Friend Class WorkflowMarkupSerializationProvider
        Implements IDesignerSerializationProvider
        ' Methods
        Public Overridable Function GetSerializer(ByVal manager As IDesignerSerializationManager, ByVal currentSerializer As Object, ByVal objectType As Type, ByVal serializerType As Type) As Object
            If ((Not serializerType Is GetType(WorkflowMarkupSerializer)) OrElse (Not currentSerializer Is Nothing)) Then
                Return Nothing
            End If
            If GetType(IDictionary).IsAssignableFrom(objectType) Then
                Return New DictionaryMarkupSerializer
            End If
            If CollectionMarkupSerializer.IsValidCollectionType(objectType) Then
                Return New CollectionMarkupSerializer
            End If
            Return New WorkflowMarkupSerializer
        End Function

    End Class
End Namespace

